/*********************************************************************************************************
Class Name: NMRAdsellErrorPageController 
* Author: Accenture IDC
* Date: 26-March-2012  
* Requirement/Project Name: NMR 
* Requirement Description: Controller class to display error messages.
* Update: Added Test Coverage class to Controller - 30th March 2012
*********************************************************************************************************/

public class NMRAdsellErrorPageController {

     public string errorMessage{get;set;}//the error message to be displayed
     public boolean showError{get;set;}//whether to display the error message or not
    
     public NMRAdsellErrorPageController (ApexPages.StandardController controller) {
        showError = false;
        errorMessage = ApexPages.currentPage().getParameters().get('error');
        if(!NMRUtil.isEmpty(errorMessage))
            showError = true;
     }
     
   //Test Method
   @isTest(SeeAllData=true)
    static void myTest() { 
      
        ID leadRecordTypeId = RecordTypeHelper.GetRecordTypeID('Lead','NMR Lead'); 
    
        lead adLead = new lead();
        adLead.FirstName = 'testleadfn';
        adLead.LastName = 'testleadln';
        adLead.Company = 'testleadcom';
        adLead.RecordTypeID = leadRecordTypeId;
            
        insert adLead;
       
        PageReference pageRef = Page.NMRAdsellErrorPage;
        pageRef.getParameters().put('error', '404 Not Found');
        Test.setCurrentPage(pageRef);
      
        ApexPages.StandardController ctrl = new ApexPages.StandardController(adLead);
        NMRAdsellErrorPageController controller = new NMRAdsellErrorPageController(ctrl);       
       
    }
}